package com.croofr.utils.configuration;

import com.croofr.utils.exceptions.configuration.ConfigurationException;

/**
 * Factory interface used for various type of Configuration (xml, properties, ...).
 * <p/>
 * User: bednar<br/>
 * Date: Jan 24, 2010<br/>
 * Time: 11:04:05 AM
 */
public interface ConfigurationFactory<T>
{

    /**
     * Load configuration with sourceObject.
     * Type of sourceObject may be property file,
     * xml file, ZooKeeper znode ant etc.
     *
     * @param sourceObject with stored configuration
     * @param parameters   for loader
     * @return loaded configuraion
     * @throws com.croofr.utils.exceptions.configuration.ConfigurationException
     *          during load stored configuration
     */
    Configuration load(T sourceObject, String... parameters) throws ConfigurationException;

    /**
     * Load configuration from source
     * specified by parameters.
     *
     * @param parameters for loader
     * @return loaded configutaion
     * @throws com.croofr.utils.exceptions.configuration.ConfigurationException
     *          during load stored configuration
     */
    Configuration load(String... parameters) throws ConfigurationException;

}
